package com.intramirror.product.enums;

/**
 * @author yaods
 * @date 2018/4/15
 * <pre>
 * </pre>
 */
public enum CouponStatusEnum {
    NOT_USED("1", "not_used"),
    USED("2", "used"),
    USING("3", "using"),
    EXPIRED("4", "expired");

    private String status;
    private String statusStr;

    /**
     * @param status
     * @param statusStr
     */
    private CouponStatusEnum(String status, String statusStr) {
        this.status = status;
        this.statusStr = statusStr;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatusStr() {
        return statusStr;
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    public static CouponStatusEnum getValueByKey(String key) {
        if (key == null) {
            return null;
        }
        CouponStatusEnum[] arrays = CouponStatusEnum.values();
        for (CouponStatusEnum couponStatusEnum : arrays) {
            if (key.equals(couponStatusEnum.getStatus())) {
                return couponStatusEnum;
            }

        }
        return null;
    }
}
